package n2352;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main2 {

	static int N=32000;
	
	static int c[]=new int[N+1];
	
	static int lowbit(int x)
	{
		return x&(-x);
	}
	
	static void modify(int cur,int n)
	{
		for(int i=cur;i<=N;i+=lowbit(i))
		{
			c[i]+=n;
		}
	}
	
	static int sum(int cur)
	{
		int cnt=0;
		for(int i=cur;i>0;i-=lowbit(i))
		{
			cnt+=c[i];
		}
		return cnt;
	}
	
	static int rank[]=new int[15000];
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {

		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(bf.readLine());
		for(int i=0;i<n;i++)
		{
			StringTokenizer st=new StringTokenizer(bf.readLine());
			int x=Integer.parseInt(st.nextToken());
			int k=sum(x+1);
			System.out.println(k);
			rank[k]++;
			modify(x+1,1);
		}
		for(int i=0;i<n;i++)System.out.println(rank[i]);
	}

}
